package beans;


import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import mapper.EmployeeMapper;

import java.io.Serializable;

/*
 * MybatisPlus会默认使用实体类的类名到数据中找对应的表.
 *
 */
//在配置文件中配置主键选择策略的话，对所有的类都是使用的，否则只对该类使用（src\main\resources\applicationContext.xml中配置）
//@TableName(value="tbl_employee")
public class Employee extends Model<Employee> {
    /*
     * @TableId:
     * 	 value: 指定表中的主键列的列名， 如果实体属性名与列名一致，可以省略不指定.
     *   type: 指定主键策略.
     */
    //在配置文件中配置主键选择策略的话，对所有的类都是使用的，否则只对该类使用（src\main\resources\applicationContext.xml中配置）
    //@TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    //@TableField(value = "last_name")//设置与数据库中字段对应项
    private String lastName;
    private String email;
    private Integer gender;
    private Integer age;
    @TableField(exist = false)//说明该字段在数据库中没有对应项
    private Double Salary;
    public Double getSalary() {
        return Salary;
    }

    public void setSalary(Double salary) {
        Salary = salary;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Employee [id=" + id + ", lastName=" + lastName + ", email=" + email
                + ", gender=" + gender + ", age="
                + age + "]";
    }
    /**
     *  指定当前类的主键属性
      */
    @Override
    protected Serializable pkVal() {
        return id;
    }
}